/*:link表示鼠标点击之前，也称为原始状态*/
/*:hover表示鼠标悬停状态*/
/*:active表示鼠标点击状态*/
/*:visited表示鼠标点击之后状态*/
.btn{
  &,&:link,&:visited{
    text-decoration: none;
    text-transform: uppercase;
    padding: 1.5rem 4rem;
    display: inline-block;
    border-radius: 10rem;
    transition: all 0.2s;
    position: relative;
    font-size: 1.6rem;
  }
  &:hover{
    transform: translateY(-0.3rem);
    /*前两个参数是x,y,第三个是阴影强度，第四个是阴影颜色*/
    box-shadow: 0 1rem 2rem rgba($color-black,0.2);
    &::after{
      transform: scaleX(1.4) scaleY(1.6);
      opacity: 0;
    }
  }
  &:active{
    transform: translateY(-0.1rem);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.2);
  }
  &::after{
    content: '';
    display: inline-block;
    height: 100%;
    width: 100%;
    border-radius: 10rem;
    /*这四句是将伪类藏到真实的对象后面去，重叠*/
    position: absolute;
    top:0;
    left:0;
    z-index: -1;
    transition: all .4s;
  }
}

.btn-white{
  margin-top: 6rem;
  background-color: $color-white;
  color: $color-gray-dark;
  &::after{
    background-color: $color-white;
  }
}

.btn-green{
  margin-top: 6rem;
  background-color: $color-primary;
  color: $color-white;
  &::after{
    background-color: $color-primary;
  }
}

/*刷新的时候向上运动，有0.75s的延迟，然后运行0.5s*/
.btn-animated{
  animation: moveInBottom .5s ease-out .75s;
  /*在 animation-delay 所指定的一段时间内，在动画显示之前，应用开始属性值（在第一个关键帧中定义）,
  这样就不会出现从零点然后跳帧的情况,延迟时间走完之后才出现第一帧*/
  /*0%{
     opacity: 0;
      transform: translateY(15px);
  }  https://segmentfault.com/q/1010000003867335 */
  animation-fill-mode: backwards;
}

.btn-text{
  &:link,&:visited{
    font-size: $default-font-size;
    color: $color-primary;
    display: inline-block;
    text-decoration: none;
    border-bottom: 1px solid $color-primary;
    padding: .5rem;
    transition: all .2s;
  }
  &:hover{
    background-color: $color-primary;
    color:$color-white;
    box-shadow: 0 1rem 2rem rgba($color-black,.15);
    transform: translateY(-.2rem);
  }
  &:active{
    box-shadow: 0 .5rem 1rem rgba($color-black,.15);
    transform: translateY(0);
  }
}

.btn-green-2{
  margin-top: 2.5rem;
  background-color: $color-primary;
  color: $color-white;
  border: none;

  &::after{
    background-color: $color-primary;
  }
}

